AGENT_CHN_BALANCE_CONFIG = {
    'real_time_report': True,
    'target_event_id': ['recharge', 'withdraw', 'tax', 'register', 'bind'],
    'values': [
        {
            "value_id": "active_count",
            "target_value": "_user_id",
            "value_name": "新增活跃用户",
            "filter": [
                {'terms': {'_event_id': ['register']}},
            ],
            "operation": "cardinality",
        },
        {
            "value_id": "register_count",
            "target_value": "_user_id",
            "value_name": "新增绑定用户",
            "filter": [
                {'terms': {'_event_id': ['bind']}},
            ],
            "operation": "cardinality",
        },
        {
            "value_id": "total_recharge",
            "target_value": "recharge_price",
            "value_name": "充值金额",
            "filter": [
                {'term': {'_event_id': 'recharge'}},
            ]
        },
        {
            "value_id": "total_withdraw",
            "target_value": "withdraw_real_price",
            "value_name": "提现金额",
            "filter": [
                {'term': {'_event_id': 'withdraw'}},
            ]
        },
        {
            "value_id": "recharge_count",
            "target_value": "_user_id",
            "value_name": "充值次数",
            "filter": [
                {'term': {'_event_id': 'recharge'}},
            ],
            "operation": "value_count"
        },
        {
            "value_id": "recharge_user",
            "target_value": "_user_id",
            "value_name": "充值人数",
            "filter": [
                {'term': {'_event_id': 'recharge'}},
            ],
            "operation": "cardinality"
        },
        {
            "value_id": "withdraw_count",
            "target_value": "_user_id",
            "value_name": "提现次数",
            "filter": [
                {'term': {'_event_id': 'withdraw'}},
            ],
            "operation": "value_count"
        },
        {
            "value_id": "agency_recharge",
            "target_value": "recharge_price",
            "value_name": "代理充值金额",
            "filter": [
                {'term': {'_event_id': 'recharge'}},
                {'terms': {'recharge_sub_type.keyword': ['agency_pay', 'mf_pay']}},
            ]
        },
        {
            "value_id": "tax_buckets",
            "target_value": "tax_tax",
            "value_name": "税费",
            "terms": {
                "field": "tax_game_id.keyword"
            }
        }
    ]
}


AGENT_CHN_GAME_DETAIL_CONFIG = {
    'real_time_report': True,
    'target_event_id': ['bet_order'],
    'group_by': 'bet_order_sub_type.keyword',
    'values': [
        {
            "value_id": "bet_amount",
            "target_value": "bet_order_bet_amount",
            "value_name": "投注额",
            "filter": [
                {'terms': {'_event_id': ['bet_order']}},
            ]
        },
        {
            "value_id": "award_amount",
            "target_value": "bet_order_award_amount",
            "value_name": "中獎額",
            "filter": [
                {'terms': {'_event_id': ['bet_order']}},
            ]
        },
        {
            "value_id": "tax_amount",
            "target_value": "bet_order_tax_amount",
            "value_name": "税收额",
            "filter": [
                {'terms': {'_event_id': ['bet_order']}},
            ],
        },
    ]
}



